from check import CheckUtils


class Customer:
    def __init__(self):
        self.__c_id = None
        self.__name = None
        self.__age = None
        self.__gender = None
        self.__phone = None

    @property
    def c_id(self):
        return self.__c_id

    @c_id.setter
    def c_id(self, c_id):
        if CheckUtils.check_id(c_id):
            self.__c_id = c_id
        else:
            raise ValueError("Invalid Customer ID")

    @property
    def name(self):
        return self.__name

    def set_name(self,  name):
        if CheckUtils.check_name(name):
            self.__name = name
        else:
            raise ValueError("Invalid Customer Name")

    @property
    def age(self):
        return self.__age

    def set_age(self, age):
        if CheckUtils.check_age(age):
            self.__age = age
        else:
            raise ValueError("Invalid Customer Age")

    @property
    def gender(self):
        return self.__gender

    def set_gender(self, gender):
        if CheckUtils.check_gender(gender):
            self.__gender = gender
        else:
            raise ValueError("Invalid Customer Gender")

    @property
    def phone(self):
        return self.__phone

    def set_phone(self, phone):
        if CheckUtils.check_phone(phone):
            self.__phone = phone
        else:
            raise ValueError("Invalid Customer Phone")

    def __str__(self):
        return (f"Customer ID: {self.__c_id}, Name: {self.__name}, Age: {self.__age}, "
                f"Gender: {self.__gender}, Phone: {self.__phone}")


if __name__ == '__main__':
    customer = Customer()
    customer.c_id = '1'
    customer.set_name('Mike')
    customer.set_age('22')
    customer.set_gender('M')
    customer.set_phone('13888888888')
    print(customer)